﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SchoolPointe.Menus.Enums;
using SchoolPointe.Menus.Models;

namespace SchoolPointe.Menus.ViewModels
{
    public abstract class MenuItemViewModel
    {
        protected MenuItemViewModel()
        {
            
        }

        protected MenuItemViewModel(BetterMenuItemPart part)
        {
            Text = part.Text;
            Id = part.Id;
            MenuItemType = part.MenuItemType;
            SortOrder = part.SortOrder;
        }

        public abstract void UpdatePart(BetterMenuItemPart part);

        public int? Id { get; private set; }
        public MenuItemType MenuItemType { get; set; }

        [HiddenInput]
        public int SortOrder { get; set; }

        [DisplayName("Menu Text")]
        [Required]
        public string Text { get; set; }
    }
}